//
//  CustomOrderButton.m
//  SameWorld(merchant)
//
//  Created by 李小朋 on 2017/4/1.
//  Copyright © 2017年 杨旭. All rights reserved.
//

#import "CustomOrderButton.h"

@implementation CustomOrderButton

- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title imageName:(NSString *)imageName
{
    self = [super initWithFrame:frame];
    if (self) {
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:(CGRectMake((self.frame.size.width - 22)/2, 10, 22, 22))];
        imageView.image = [UIImage imageNamed:imageName];
        [self addSubview:imageView];
        
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:(CGRectMake((self.frame.size.width - 40)/2, imageView.frame.size.width+ imageView.frame.origin.y + 12,40 , 12))];
        titleLabel.text = title;
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = [UIFont systemFontOfSize:12];
        titleLabel.textColor = [UIColor darkGrayColor];
        [self addSubview:titleLabel];
    }
    return self;
}


@end
